package com.bdzl.flow.servicefeign;

import com.bdzl.flow.common.config.FeignConfig;
import com.bdzl.flow.servicefeign.impl.AuthFeginServiceHystrix;
import com.bdzl.pub.config.Constant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
* @Description: TODO
* @return:
* @Author: Ming
* @Date: 2021/5/13 17:06 ,fallback = UserServiceHystrix.class
*/
@FeignClient(name="loanAuth", configuration = FeignConfig.class,contextId = "UserFeginService",fallback = AuthFeginServiceHystrix.class,url = Constant.sys+":8002")
public interface AuthFeginService {
    /**
     * 根据id获取用户数据
     * @return
     */
    @PostMapping(value = "/bdzl/user/getUserById")
    Object getUserById(@RequestParam("userId")Integer userId);

    /**
    * @Description: TODO 根据角色id获取角色数据
    * @param roleId 角色id
    * @return: java.lang.Object
    * @Author: Ming
    * @Date: 2021/5/17 10:43
    */
    @PostMapping(value = "/bdzl/role/getRoleById")
    Object getRoleById(@RequestParam("roleId")Integer roleId);

    /**
     * @Description: TODO 根据token获取用户信息
     * @param token
     * @return: java.lang.Object
     * @Author: Ming
     * @Date: 2021/5/19 19:07
     */
    @PostMapping(value = "/bdzl/user/getUser")
    Object getUser(@RequestParam("token") String token);
}
